<template>
    <view>
		<u-navbar :safeAreaInsetTop="false" title="添加企业" :fixed="false" left-text="首页" right-text="新增企业" @rightClick="rightClick"
			@leftClick="leftClick" rightIcon="plus"> </u-navbar>
        <view @scrolltolower="scrolltolower">
            <view v-for="(item, index) in indexList" :key="index">			
				
				<view  style="border-bottom: 1px solid #dcdcdc;padding-bottom: 20rpx; margin-bottom: 20rpx;" @click="qydetail(item)">
					<view :class="{redStr: item.status=='hidden'}">
						
					<view class="u-m-b-10 u-text-weight title"> <text v-text="item.dwmc"></text> 
						<view v-if="item.status=='hidden'"> 未核实 </view> 
					</view> 
					
					<view class="u-line-3 u-tips-color">地址:{{ item.dwzcdz_xxdz }}</view>
					<view class="u-line-3 u-tips-color">法人:{{ item.fddbr_xm }}</view>
					<view class="u-line-3 u-tips-color">法人:{{ item.fddbr_lxdh }}</view>
					
					</view>
					
					</view>
				
             <!--   <u-cell
                    :title="item.name"
                    :label="'地址:' + item.dizhi + '法人:' + item.faren "
                    :titleStyle="`item.score<70?{color:#ff0000}:{}`"
                    :value="'数量:'+item.nums"
                    isLink
                    @click="showdetail(item)"
                >
                    <u-avatar slot="icon" shape="square" size="35" :src="item.url" customStyle="margin: -3px 5px -3px 0"></u-avatar>
                </u-cell> -->
       	    </view>
        </view>
    </view>
</template>

<script>
export default {
    data() {
        return {
            indexList: [],
			page:1,
            urls: [
                'https://cdn.uviewui.com/uview/album/1.jpg',
                'https://cdn.uviewui.com/uview/album/2.jpg',
                'https://cdn.uviewui.com/uview/album/3.jpg',
                'https://cdn.uviewui.com/uview/album/4.jpg',
                'https://cdn.uviewui.com/uview/album/5.jpg',
                'https://cdn.uviewui.com/uview/album/6.jpg',
                'https://cdn.uviewui.com/uview/album/7.jpg',
                'https://cdn.uviewui.com/uview/album/8.jpg',
                'https://cdn.uviewui.com/uview/album/9.jpg',
                'https://cdn.uviewui.com/uview/album/10.jpg'
            ]
        };
    },
    onLoad() {
          this.qiyelst();
    },
    methods: {
		
		qiyelst: async function() {
			 
			let res = await this.$api.uavqiyes();
			this.indexList=res.qiyelst;
			console.log(res);
			 
		},
		qydetail(item){
			//console.log(item);
			 uni.$u.route({url: '/pages/index/wurenji/wrjqiyedetail', params: { id: item.id } })
		},
		rightClick() {			 
			 uni.$u.route({url: '/pages/index/wurenji/addqiye' })
		},
		
		leftClick() {
			uni.$u.route({type: 'tab',url: 'pages/index/index'})
		},
		
        showdetail(item) {
            // console.log(item);
            uni.$u.route({ url: 'pages/index/wurenji/wrjqiyedetail', params: { id: item.id } });
        },
        scrolltolower() {
            this.uavindex();
        },
    
		uavindex(){
			this.page++;
			 this.$api.uavqiyes({page:this.page,pagesize:10}).then(res => {
				
				console.log(res);
				this.indexList=res.qiyelst;						 
			});
			 
		}
	}

};
</script>

<style>
	.redStr{
	  color: red;
	  background-color: #dcdcdc;
	}
</style>
